package com.tn.controller.alarm.common.model.alarm.entity;

import com.tn.controller.alarm.common.constants.Constants;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * 告警Entity
 *
 * @program: tn_aucy_java
 * @author: yangjiayao
 * @create: 2022/2/18
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
public class AlarmDO {
    /**
     * ID
     */
    private Integer id;

    /**
     * 名称
     */
    private String name = "装载车超区告警";

    /**
     * 标签
     */
    private String tagId;

    /**
     * 楼层
     */
    private Integer floor;

    /**
     * 车牌
     */
    private String license;

    /**
     * 区域ID
     */
    private Integer areaId;

    /**
     * 类型
     */
    private Integer kind = 1;

    /**
     * 告警原因
     */
    private Integer alarmReason = 1;

    /**
     * 告警级别
     */
    private Integer alarmLevel = 1;

    /**
     * 告警状态
     */
    private Integer state;

    /**
     * 告警处理结果
     */
    private String results;

    /**
     * 告警开始时间
     */
    private String startTime;

    /**
     * 告警结束时间
     */
    private String endTime;

    /**
     * 处理人
     */
    private String operator;

    /**
     * 处理时间
     */
    private String operateTime;

    /**
     * 理货任务ID
     */
    private String tallyTaskNo;

    /**
     * 附属信息
     */
    private String extras;

    /**
     * 生成处理结果
     *
     * @param id          告警ID
     * @param operator    处理人
     * @param operateTime 处理时间
     */
    public AlarmDO(Integer id, String operator, String operateTime) {
        this.id = id;
        this.operator = operator;
        this.operateTime = operateTime;
        this.endTime = operateTime;
        this.results = Constants.ALARM_RESULT;
        this.state = Constants.ALARM_END;
    }
}
